Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…ty.zod.ts Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
…ty.zod.ts Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
…ibility Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
…wn() 351, fix MetricType collision Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Finishes Phase 4 audit cleanups in packages/spec by increasing Zod .describe() coverage, adding optional metadata extensibility fields to several top-level schemas, and resolving the MetricType naming collision between analytics and Prometheus metrics.
Changes:
- Added/expanded
.describe()annotations across Hub-related API/security schemas and regenerated JSON Schemas. - Added optional
metadata: z.record(z.string(), z.unknown())to multiple top-level entities for extensibility and regenerated JSON Schemas. - Renamed analytics
MetricTypetoAggregationMetricTypeto eliminate schema name collisions and regenerated JSON Schemas + updated DEVELOPMENT_PLAN metrics.
Reviewed changes
Copilot reviewed 67 out of 67 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/spec/src/system/change-management.zod.ts | Adds optional metadata field to ChangeRequest for extensibility. |
| packages/spec/src/kernel/plugin-structure.zod.ts | Adds optional metadata fields to OPS plugin structure schemas. |
| packages/spec/src/hub/plugin-security.zod.ts | Adds extensive .describe() annotations across plugin security schemas. |
| packages/spec/src/hub/hub-federation.zod.ts | Adds optional metadata fields to federation entities for extensibility. |
| packages/spec/src/data/analytics.zod.ts | Renames analytics MetricType to AggregationMetricType to avoid collisions. |
| packages/spec/src/api/hub.zod.ts | Adds .describe() annotations to Hub API contracts and request/response schemas. |
| packages/spec/src/api/discovery.zod.ts | Adds optional metadata field to Discovery schema for extensibility. |
| packages/spec/json-schema/system/ChangeRequest.json | Regenerated JSON schema reflecting ChangeRequest metadata. |
| packages/spec/json-schema/kernel/OpsPluginStructure.json | Regenerated JSON schema reflecting OPS plugin structure metadata. |
| packages/spec/json-schema/kernel/OpsDomainModule.json | Regenerated JSON schema reflecting OPS domain module metadata. |
| packages/spec/json-schema/hub/VulnerabilitySeverity.json | Regenerated JSON schema with added enum description. |
| packages/spec/json-schema/hub/SecurityVulnerability.json | Regenerated JSON schema with added property/schema descriptions. |
| packages/spec/json-schema/hub/SecurityScanResult.json | Regenerated JSON schema with added property/schema descriptions. |
| packages/spec/json-schema/hub/SecurityPolicy.json | Regenerated JSON schema with added property/schema descriptions. |
| packages/spec/json-schema/hub/SBOMEntry.json | Regenerated JSON schema with added property/schema descriptions. |
| packages/spec/json-schema/hub/SBOM.json | Regenerated JSON schema with added property/schema descriptions. |
| packages/spec/json-schema/hub/Region.json | Regenerated JSON schema reflecting Region metadata. |
| packages/spec/json-schema/hub/PluginTrustScore.json | Regenerated JSON schema with added property/schema descriptions. |
| packages/spec/json-schema/hub/PluginProvenance.json | Regenerated JSON schema with added property/schema descriptions. |
| packages/spec/json-schema/hub/PackageDependency.json | Regenerated JSON schema with added property/schema descriptions. |
| packages/spec/json-schema/hub/HubInstance.json | Regenerated JSON schema reflecting HubInstance metadata. |
| packages/spec/json-schema/hub/FederationTopology.json | Regenerated JSON schema reflecting FederationTopology metadata. |
| packages/spec/json-schema/hub/EdgeLocation.json | Regenerated JSON schema reflecting EdgeLocation metadata. |
| packages/spec/json-schema/hub/DependencyResolutionResult.json | Regenerated JSON schema with added property/schema descriptions. |
| packages/spec/json-schema/hub/DependencyGraphNode.json | Regenerated JSON schema with added property/schema descriptions. |
| packages/spec/json-schema/hub/DependencyGraph.json | Regenerated JSON schema with added property/schema descriptions. |
| packages/spec/json-schema/hub/DependencyConflict.json | Regenerated JSON schema with added property/schema descriptions. |
| packages/spec/json-schema/data/AggregationMetricType.json | Regenerated JSON schema reflecting analytics enum rename. |
| packages/spec/json-schema/api/ValidateLicenseResponse.json | Regenerated JSON schema with added property/schema descriptions. |
| packages/spec/json-schema/api/ValidateLicenseRequest.json | Regenerated JSON schema with added property/schema descriptions. |
| packages/spec/json-schema/api/UpdateTenantRequest.json | Regenerated JSON schema with added property/schema descriptions. |
| packages/spec/json-schema/api/UpdateSpaceRequest.json | Regenerated JSON schema with updated request descriptions. |
| packages/spec/json-schema/api/UpdatePluginRequest.json | Regenerated JSON schema with updated request description. |
| packages/spec/json-schema/api/TenantResponse.json | Regenerated JSON schema with updated response descriptions. |
| packages/spec/json-schema/api/SpaceResponse.json | Regenerated JSON schema with updated response descriptions. |
| packages/spec/json-schema/api/SearchPluginsResponse.json | Regenerated JSON schema with pagination/data descriptions. |
| packages/spec/json-schema/api/RevokeLicenseRequest.json | Regenerated JSON schema with updated request description. |
| packages/spec/json-schema/api/PublishPluginRequest.json | Regenerated JSON schema with updated request description. |
| packages/spec/json-schema/api/PluginVersionInfo.json | Regenerated JSON schema with updated schema/property descriptions. |
| packages/spec/json-schema/api/PluginResponse.json | Regenerated JSON schema with updated response descriptions. |
| packages/spec/json-schema/api/PaginationResponse.json | Regenerated JSON schema with updated schema/property descriptions. |
| packages/spec/json-schema/api/PaginationRequest.json | Regenerated JSON schema with updated schema/property descriptions. |
| packages/spec/json-schema/api/MarketplacePluginResponse.json | Regenerated JSON schema with updated response descriptions. |
| packages/spec/json-schema/api/ListTenantsResponse.json | Regenerated JSON schema with pagination/data descriptions. |
| packages/spec/json-schema/api/ListTenantsRequest.json | Regenerated JSON schema with updated request description. |
| packages/spec/json-schema/api/ListSpacesResponse.json | Regenerated JSON schema with pagination/data descriptions. |
| packages/spec/json-schema/api/ListSpacesRequest.json | Regenerated JSON schema with updated request description. |
| packages/spec/json-schema/api/ListMarketplaceResponse.json | Regenerated JSON schema with pagination/data descriptions. |
| packages/spec/json-schema/api/ListMarketplaceRequest.json | Regenerated JSON schema with updated request description. |
| packages/spec/json-schema/api/ListLicensesResponse.json | Regenerated JSON schema with pagination/data descriptions. |
| packages/spec/json-schema/api/ListLicensesRequest.json | Regenerated JSON schema with updated request description. |
| packages/spec/json-schema/api/LicenseResponse.json | Regenerated JSON schema with updated response descriptions. |
| packages/spec/json-schema/api/IssueLicenseRequest.json | Regenerated JSON schema with updated request description. |
| packages/spec/json-schema/api/InstallPluginResponse.json | Regenerated JSON schema with updated response description. |
| packages/spec/json-schema/api/InstallPluginRequest.json | Regenerated JSON schema with updated request description. |
| packages/spec/json-schema/api/HubMetricsResponse.json | Regenerated JSON schema with updated schema/property descriptions. |
| packages/spec/json-schema/api/HubHealthResponse.json | Regenerated JSON schema with updated schema/property descriptions. |
| packages/spec/json-schema/api/GetPluginVersionsResponse.json | Regenerated JSON schema with updated response descriptions. |
| packages/spec/json-schema/api/GetPluginVersionsRequest.json | Regenerated JSON schema with updated request description. |
| packages/spec/json-schema/api/GetMarketplacePluginRequest.json | Regenerated JSON schema with updated request description. |
| packages/spec/json-schema/api/GetBuildStatusRequest.json | Regenerated JSON schema with updated request description. |
| packages/spec/json-schema/api/Discovery.json | Regenerated JSON schema reflecting Discovery metadata. |
| packages/spec/json-schema/api/CreateTenantRequest.json | Regenerated JSON schema with updated request description. |
| packages/spec/json-schema/api/CreateSpaceRequest.json | Regenerated JSON schema with updated request description. |
| packages/spec/json-schema/api/CompileManifestResponse.json | Regenerated JSON schema with updated response descriptions. |
| packages/spec/json-schema/api/BuildStatusResponse.json | Regenerated JSON schema with updated schema/property descriptions. |
| packages/spec/DEVELOPMENT_PLAN.md | Updates Phase 4 metrics table and breaking-change notes. |
| page: z.number().int().min(1).default(1).optional().describe('Page number (1-indexed)'), | ||
|
|
||
| /** | ||
| * Number of items per page | ||
| */ | ||
| perPage: z.number().int().min(1).max(100).default(20).optional(), | ||
| perPage: z.number().int().min(1).max(100).default(20).optional().describe('Number of items per page'), |
There was a problem hiding this comment.
page/perPage are defined as .default(...).optional(). In Zod, wrapping a default schema with .optional() prevents the default from being applied (parsing undefined returns undefined, not the default). To actually default missing values, drop .optional() or move it before .default() (i.e., apply .default() last).
| */ | ||
| sortOrder: z.enum(['asc', 'desc']).default('desc').optional(), | ||
| }); | ||
| sortOrder: z.enum(['asc', 'desc']).default('desc').optional().describe('Sort direction'), |
There was a problem hiding this comment.
sortOrder is declared as .default('desc').optional(), which prevents the default from being applied when the field is omitted. If you want desc to be the runtime default, remove .optional() or apply .default() after optionality (default last).
The DEVELOPMENT_PLAN.md marked all phases complete but three metrics fell short of Phase 4 targets:
.describe()at 5,341/5,600,z.unknown()at 343/350, and one remaining schema name collision..describe()annotations (+330)hub/plugin-security.zod.tsandapi/hub.zod.ts— the two largest annotation gapsz.unknown()extensibility (+8)metadata: z.record(z.string(), z.unknown())to 8 top-level entity schemas acrosshub/hub-federation,system/change-management,kernel/plugin-structure,api/discoveryMetricType name collision resolved
MetricType→AggregationMetricTypeindata/analytics.zod.tssystem/metrics.zod.tsMetricType(Prometheus types) remains canonicalUpdated metrics table in DEVELOPMENT_PLAN.md
z.any()z.unknown().describe()97 test files, 3,074 tests pass. Build produces 1,207 JSON schemas.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.